import { getTeacherDetail } from '../../../api/user'

Page({

  /**
   * 页面的初始数据
   */
  data: {
    user: {}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.init(options.userId)
  },
  init(id) {
    getTeacherDetail({ userId: id }).then(res => {
      this.setData({
        user: res
      })
    })
  },

  viewMore() {
    const userId = this.data.user.userId
    wx.navigateTo({
      url:`/packageA/pages/teacher/detail/detail?userId=${userId}`
    })
  }
})
